package SingletonDemo.example;

/**
 * @author zsh
 * @Description 只生产一个实例，单例模式
 * @create 2022-05-13 19:27
 */
public class SingletonDemo {
    private static SingletonDemo singletonDemo = new SingletonDemo();

    private SingletonDemo(){
        System.out.println("生成一个实例");
    }

    public static SingletonDemo getInstance(){
        return singletonDemo;
    }
}
